﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ChuongtrinhTracnghiem
{
    public partial class FormThongtin : Form
    {
        public FormThongtin()
        {
            InitializeComponent();
        }
        
        public static string UserID;
        public static string Hoten ;
        public static int Socau=0;

        private void FormThongtin_Load(object sender, EventArgs e)
        {
            string s = "select * from TblUser";
            DataTable ds = new DataTable();
            Model.Laydulieu dl = new Model.Laydulieu();
            ds = dl.Dulieu(s, "TblUser");
            comboBox_UserID.DataSource = ds;
            comboBox_UserID.DisplayMember = ds.Columns[1].ToString();
            comboBox_UserID.ValueMember = ds.Columns[0].ToString();
            comboBox_UserID.Text = "";
            Model.Ketnoi.Boketnoi();
        }

        private void button_Tieptuc_Click(object sender, EventArgs e)
        {
            FormThongtin f = new FormThongtin();
            f.Hide();
            try
            {
                UserID = comboBox_UserID.SelectedValue.ToString();
                Socau = Convert.ToInt32(TextBox_Socau.Text);
                Hoten = comboBox_UserID.Text;
                FormThi f1 = new FormThi();
                f1.MdiParent = this.MdiParent;
                f1.Show();
            }
            catch { MessageBox.Show("Nhập thông tin chưa đúng"); }
        }
    }
}
